package io.github.jianjianghui.groot.core;

/**
 * Groot 异常
 *
 * @author <a href="https://www.github.com/jianjianghui">Jianghui Jian<a/>
 * @date 2021/9/6 - 11:14
 */
public class GrootException extends RuntimeException {
    int code;
    String message;

    public GrootException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return String.format("<%s> %s", code, message);
    }

    public String message() {
        return this.message;
    }
}
